#include <cstdio>
#include <map>
#include <cmath>
using namespace std;

int main_35()
{
    int n,X,Y,xi,yi;
    scanf("%d%d%d",&n,&X,&Y);
    multimap<float,int> distance_multimap;
    for (int i=1;i<=n ;i++ )
    {
        scanf("%d%d",&xi,&yi);
        distance_multimap.insert(make_pair(pow(X-xi,2)+pow(Y-yi,2),i));
    }
    multimap<float,int>::iterator it=distance_multimap.begin();
    for (int i=0;i<3 ;i++ )
    {
        printf("%d\n",it->second);
        it++;
    }
    return 0;
}

